From 887a21afb97aaa358017a4722c23654aaa7e3d72 Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Tue, 28 Jan 2014 12:09:35 -0500 Subject: [PATCH] appDisplay: Properly check for TerminalEmulator in the Categories key get_categories() returns an unparsed string, not a list of categories. We need to parse the list by splitting on ';' to deterine whether the actual 'TerminalEmulator' category is in the list, rather than something like 'X-GNOME-TerminalEmulator'. It's an edge case, but I need to split the list properly for the new folders, so I might as well fix this. https://bugzilla.gnome.org/show_bug.cgi?id=723179 --- js/ui/appDisplay.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js index b30e49d1d..921d83b07 100644 --- a/js/ui/appDisplay.js +++ b/js/ui/appDisplay.js @@ -46,11 +46,18 @@ const INDICATORS_ANIMATION_MAX_TIME = 0.75; const PAGE_SWITCH_TRESHOLD = 0.2; const PAGE_SWITCH_TIME = 0.3; +function _getCategories(info) { + let categoriesStr = info.get_categories(); + if (!categoriesStr) + return []; + return categoriesStr.split(';'); +} + function _isTerminal(app) { let info = app.get_app_info(); if (!info) return false; - let categories = info.get_categories() || []; + let categories = _getCategories(info); return categories.indexOf('TerminalEmulator') > -1; } -- 2.39.5